package com.igeekhome.microserviceprovideruser7002.controller;

import com.igeekhome.microserviceprovideruser7002.mapper.UserMapper;
import com.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : FMH
 * @Date : 2020/2/21 10:34
 * @Description : 微服务中每个服务都需要向外部暴露HTTP API接口
 *http://localhost:8081/user/get/1
 * @Modify By : 86159
 * @Version :
 */
@RequestMapping("user")
@RestController
public class UserController {

    @Autowired
    private UserMapper mapper;

    @RequestMapping("/get/{id}")
    public User get(@PathVariable Long id){
        return mapper.selectById(id);
    }
}
